package org.linys.action.common;



import net.sf.json.JSONObject;

import org.linys.action.BaseAction;
import org.linys.service.common.CommonServ;
import org.linys.util.ResponseMsgUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

@SuppressWarnings({  "unchecked" })
@Controller("CommonAction")
@Scope("prototype")
public class CommonAction extends BaseAction{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private ResponseMsgUtil responseMsgUtil;
	private CommonServ commonServ;
	
	public void getCode(){
		String type = request.getParameter("type");
		String code = request.getParameter("code");
		JSONObject object = new JSONObject();
		object.put("success",1);
		object.put("newCode",commonServ.getCode(type, code));
		this.responseMsgUtil.doResponse(object.toString());
		
	}
	public ResponseMsgUtil getResponseMsgUtil() {
		return responseMsgUtil;
	}
	@Autowired
	public void setResponseMsgUtil(ResponseMsgUtil responseMsgUtil) {
		this.responseMsgUtil = responseMsgUtil;
	}
	public CommonServ getCommonServ() {
		return commonServ;
	}
	@Autowired
	public void setCommonServ(CommonServ commonServ) {
		this.commonServ = commonServ;
	}
}
